package view;

import java.util.ArrayList;
import java.util.List;

import lecture.Lecture;
import model.Entity;

public class View extends Entity{
	protected List<View> views;
	protected List<Lecture> lectures;
	
	public View(){
		super("Default");
		this.views = new ArrayList<View>();
		this.lectures = new ArrayList<Lecture>();
	}
	
	public View(String name) 
	{
		super(name);
		this.views = new ArrayList<View>();
		this.lectures = new ArrayList<Lecture>();
	}
	
	public void addView(View v)
	{
		this.views.add(v);
	}
	
	public boolean removeView(View v)
	{
		return this.views.remove(v);
	}
	
	public void addLecture(Lecture l)
	{
		this.lectures.add(l);
	}
	
	public boolean removeView(Lecture l)
	{
		return this.views.remove(l);
	}
	
	public List<View> getViews() {
		return views;
	}

	public void setViews(List<View> views) {
		this.views = views;
	}

	public List<Lecture> getLectures() {
		return lectures;
	}

	public void setLectures(List<Lecture> lectures) {
		this.lectures = lectures;
	}

	public String toString()
	{
		StringBuilder tmp = new StringBuilder("view");
		tmp.append("\npviews: "); for(View v:this.views) {tmp.append(v.getName()); tmp.append(' ');};
		tmp.append("\nplectures: "); for(Lecture l:this.lectures) {tmp.append(l.getName()); tmp.append(' ');};
		return tmp.toString();
	}
}
